import axios from "@/utils/request";

//测 列表
export interface MyHomeworkdata {
  subjectID: any; // 学科id
  keyword: string; // 关键字
  page: number; //页码
  limit: number; //  显示条数
}

export function postMyHomeworkdocsaveData(params: MyHomeworkdata) {
  return axios.post("/api/MyHomework/docsaveData", params);
}
// 测 发送试卷
// url:/api/MyHomework/sendDoc
// 参数 subjectID 学科
//      ids  []
export interface MyHomeworksendDocData {
  subjectID: string; // 学科id
  ids: string; // 关键字
}

export function postMyHomeworksendDoc(params: MyHomeworksendDocData) {
  return axios.post("/api/MyHomework/sendDoc", params);
}

// 开始答题
export function postMyHomeworkctrList() {
  return axios.post("/api/MyHomework/ctrList");
}
// 添加答题记录
export interface MyHomeworkstudentData {
  ctrID: string; // 学科id
}
export function postMyHomeworkstudent(params: MyHomeworkstudentData) {
  return axios.post("/api/MyHomework/student", params);
}

//试卷详情/api/MyHomework/getTest
export interface MyHomeworkgetTestData {
  ctrID: string; // 学科id
}
export function postMyHomeworkgetTest(params: MyHomeworkgetTestData) {
  return axios.post("/api/MyHomework/getTest", params);
}
// 点击试题答案时提交的数据
export interface MyHomeworkdoAnswerData {
  realTime: string; // 时长
  answer_num: string; //题数
  anwser_right: string;
  answer_id: string;
  answer: string; //答案
  
}
export function postMyHomeworkdoAnswer(params: MyHomeworkdoAnswerData) {
  return axios.post("/api/MyHomework/doAnswer", params);
}

// 答题提交/api/MyHomework/doSubmit

export interface postMyHomeworkdoSubmittData {
  testRecordID: string; // 试卷id
  realTime: string; // 试卷id
}
export function postMyHomeworkdoSubmit(params:postMyHomeworkdoSubmittData) {
  return axios.post("/api/MyHomework/doSubmit",params);
}

// 查看试卷结果
export interface MyHomeworkreturnTestListData {
  testId: string; // 试卷id
}
export function postMyHomeworkreturnTestList(
  params: MyHomeworkreturnTestListData
) {
  return axios.post("/api/MyHomework/returnTestList", params);
}

// 批改
export interface MyHomeworkdocCorrectdata {
  ctrID: string; // 试卷id
}
export function MyHomeworkdocCorrect(
  params: MyHomeworkdocCorrectdata
) {
  return axios.post("/api/MyHomework/docCorrect", params);
}

